package org.spolo.android.util;

import java.util.HashMap;
import java.util.Map;

import android.content.Context;

public class ContextManager {
	private Map<String,Context> contextSet = new HashMap<String, Context>();
	private static ContextManager instance;
	private ContextManager(){
	
	}
	public static ContextManager getInstance(){
		if(instance == null){
			instance = new ContextManager();
		}
		return instance;
	}
	/**
	 * 向该类中注册context对象
	 * @param name
	 * @param cont
	 */
	public void regContext(String name,Context cont){
		contextSet.put(name, cont);
	}
	/**
	 * 根据名称从里面取出context对象
	 * @param name
	 * @return
	 */
	public Context getContext(String name){
		return contextSet.get(name);
	}
}
